//
//  RedBagSendBtnCell.m
//  智积分
//
//  Created by Cynic on 2018/7/26.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "RedBagSendBtnCell.h"

@implementation RedBagSendBtnCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
//    UIView *bgView = [[UIView alloc] initWithFrame:CGRectZero];
//    bgView.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.5];
//    [self.contentView addSubview:bgView];
//    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(15);
//        make.right.mas_equalTo(-15);
//        make.top.mas_equalTo(0);
//        make.bottom.mas_equalTo(0);
//    }];
    
//    UIView *layerView = [[UIView alloc] initWithFrame:CGRectZero];
//    layerView.backgroundColor = [UIColor whiteColor];
//    layerView.layer.cornerRadius = 5;
//    [bgView addSubview:layerView];
//    [layerView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(15);
//        make.right.mas_equalTo(-15);
//        make.top.mas_equalTo(10);
//        make.bottom.mas_equalTo(-10);
//    }];
    
    _Sure = [[UIButton alloc] initWithFrame:CGRectZero];
    
        [self.contentView addSubview:_Sure];
    [_Sure mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.right.mas_equalTo(-12);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(44);
        make.bottom.mas_equalTo(-36);
    }];
    
//    _Sure.layer.cornerRadius = 5;
//    _Sure.backgroundColor = BaseColor;
    [_Sure setTitle:@"发送到微信" forState:UIControlStateNormal];
    _Sure.layer.cornerRadius = 22;
    _Sure.clipsToBounds = YES;
    [_Sure setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _Sure.titleLabel.font = [UIFont systemFontOfSize:18];
    CAGradientLayer *layer = [CAGradientLayer layer];
    layer.frame = CGRectMake(0, 0, cx_wid - 24, 44);
    layer.colors = @[(id)[CXSinglerModel colorWithHex:@"#FF7F5A" alpha:1].CGColor,(id)[CXSinglerModel colorWithHex:@"#FE4438" alpha:1].CGColor];
    layer.startPoint = CGPointMake(0, 0);
    layer.endPoint = CGPointMake(1, 0);
    [_Sure.layer addSublayer:layer];
    [_Sure bringSubviewToFront:_Sure.titleLabel];

    
    
    _notice = [[UILabel alloc] init];
    _notice.textAlignment = NSTextAlignmentCenter;
    _notice.font = [UIFont systemFontOfSize:14];
    _notice.textColor = [UIColor ColorWithHex:@"A5A5A5" withAlpha:1];
    [self.contentView addSubview:_notice];
    [_notice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.right.mas_equalTo(-12);
        make.height.mas_equalTo(14);
        make.bottom.mas_equalTo(-10);
    }];
    
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
